﻿$(document).ready(function () {
    $.ajax({
        url: "/Case/GetCaseCategoryList",
        success: function (data) {

            var content = "<div style=\"height: 161px;margin-left:10px;float:left;\"><img alt=\"test\" class=\"mainImg\" src=\"{0}\" /><div class=\"mWord\" style=\"background-color: #{1};padding-top:4px;\">{2}<br /><span style=\"font-size: 13px;\">{3}</span></div></div>";
            var ul = document.createElement("ul");
            $(data).each(function () {
                var temp = this;
                var li = document.createElement("li");
                var div = document.createElement("div");
                var dd = content.replace("{0}", temp.Img).replace("{1}", temp.Color).replace("{2}", temp.ClassName).replace("{3}", temp.Remark);
                $(div).html(dd);
                $(li).html($(div).html());
                $(ul).html($(ul).html() + li.outerHTML);
            });
            $("#MainImgHolder").html(ul.outerHTML);
        }
    });
});